/*
 *	\file defines.h
 *	Java Usb Device Management [libjpmp.so]
 *	Copyright (C) 2008  cmi [netcmi78@gmail.com]
 *	Based on Media Transfer Protocol library libmtp
 *
 *	This program is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *	
 *	You should have received a copy of the GNU General Public License
 *	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *	
 */
 
#ifndef JUSB_DEFINES_H
#define JUSB_DEFINES_H

#ifndef SAFE_RELEASE
#define SAFE_RELEASE(x) \
   if(x != NULL)        \
   {                    \
      x->Release();     \
      x = NULL;         \
   }
#endif

#ifndef SAFE_COMPTR_RELEASE
#define SAFE_COMPTR_RELEASE(x) \
   if(x.p != NULL)        \
   {                    \
      x.Release();     \
      x = NULL;         \
   }


#endif



#ifdef __cplusplus
extern "C" {
#endif
#undef jpmp_device_UsbDevice_USB_MODE_CONNECTED
#define jpmp_device_UsbDevice_USB_MODE_CONNECTED 0L
#undef jpmp_device_UsbDevice_USB_MODE_MSC
#define jpmp_device_UsbDevice_USB_MODE_MSC 1L
#undef jpmp_device_UsbDevice_USB_MODE_MTP
#define jpmp_device_UsbDevice_USB_MODE_MTP 2L
#undef jpmp_device_UsbDevice_ERROR_SUCCESS
#define jpmp_device_UsbDevice_ERROR_SUCCESS 0LL
#undef jpmp_device_UsbDevice_ERROR_UNKNOWN_DEVICE
#define jpmp_device_UsbDevice_ERROR_UNKNOWN_DEVICE 1LL
#undef jpmp_device_UsbDevice_ERROR_FILE_NOTFOUND
#define jpmp_device_UsbDevice_ERROR_FILE_NOTFOUND 2LL
#undef jpmp_device_UsbDevice_ERROR_FOLDER_NOTFOUND
#define jpmp_device_UsbDevice_ERROR_FOLDER_NOTFOUND 3LL
#undef jpmp_device_UsbDevice_ERROR_FOLDER_NOTEMPTY
#define jpmp_device_UsbDevice_ERROR_FOLDER_NOTEMPTY 4LL
#undef jpmp_device_UsbDevice_ERROR_METADATA_PROPERTY
#define jpmp_device_UsbDevice_ERROR_METADATA_PROPERTY 5LL
#undef jpmp_device_UsbDevice_ERROR_INVOKE_METHOD
#define jpmp_device_UsbDevice_ERROR_INVOKE_METHOD 6LL
#undef jpmp_device_UsbDevice_ERROR_INIT_DEViCEMANAGER
#define jpmp_device_UsbDevice_ERROR_INIT_DEViCEMANAGER 7LL
#undef jpmp_device_UsbDevice_ERROR_DEVICE_NOTMOUNTED
#define jpmp_device_UsbDevice_ERROR_DEVICE_NOTMOUNTED 8LL
#undef jpmp_device_UsbDevice_ERROR_PATH_EXISTS
#define jpmp_device_UsbDevice_ERROR_PATH_EXISTS 9LL
#undef jpmp_device_UsbDevice_ERROR_MTP_NOTAVAILABLE
#define jpmp_device_UsbDevice_ERROR_MTP_NOTAVAILABLE 10LL
#undef jpmp_device_UsbDevice_ERROR_MSC_NOTAVAILABLE
#define jpmp_device_UsbDevice_ERROR_MSC_NOTAVAILABLE 11LL
#undef jpmp_device_UsbDevice_ERROR_WRONG_PARAMETER
#define jpmp_device_UsbDevice_ERROR_WRONG_PARAMETER 12LL
#undef jpmp_device_UsbDevice_ERROR_UNKNOWN
#define jpmp_device_UsbDevice_ERROR_UNKNOWN 1000LL
#undef jpmp_device_UsbDevice_ERROR_NOTIMPL
#define jpmp_device_UsbDevice_ERROR_NOTIMPL 2000LL
#ifdef __cplusplus
}
#endif

#endif
